package com.example.utils;

import lombok.Data;

import java.util.List;

/**
 * @descriptions:
 * @author:
 * @date: 2022/7/18 16:50
 */
@Data
public class PageResult {

    private int pageSize;
    private int pageNum;
    private Long total;
    private int pages;
    private List<?> content;

    public static PageResult getPageResult(List content,PageRequest pageRequest, Long total){
        PageResult pageResult = new PageResult();
        pageResult.setContent(content);
        pageResult.setPageNum(pageRequest.getPageNum());
        pageResult.setPageSize(pageRequest.getPageSize());
        pageResult.setTotal(total);
        return pageResult;
    }
}
